package com.institute.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import com.common.util.TreeNode;
import com.institute.entity.Institute;
import com.institute.entity.dto.InstituteDTO;
import com.institute.entity.dto.PositionDTO;
import com.institute.entity.dto.PrincipalDTO;
import com.staff.entity.Staff;

public interface IInstituteService {
	
	public void saveOrUpdate(InstituteDTO dto);
	public void deleteInstitute(Long id);
	public List<Institute> findAll();
	public boolean hasChildren(Long id);
	public Institute findOne(Long id);
	public Institute findFather(Institute institute);
	public Integer getStaffNum(Institute institute);
	public Staff getPrinsipal(Institute institute);
	public Institute findDeptByName(String name);
	public Page<Institute> findAll(Specification<Institute> spec, Pageable pageable);
	public void combineInstitute(Long fatherId,Long childId);
	public boolean isSubordinateDept(Long id,Long searchId);
	public void moveInstitute(Long fatherId,Long childId);
	public boolean hasPositions(Long id);
	public boolean hasStaffs(Long id);
	public void selectPrincipal(Long deptId,Long staffId);
	public Page<PrincipalDTO> findStaffByDept(PrincipalDTO dto,Pageable pageable);
	public List<Institute> findCombineDept(Long id);
	public List<Institute> findMoveDept(Long id);
	public boolean isNameExist(InstituteDTO dto);
	public boolean isCodeExist(InstituteDTO dto);
	public boolean isPrincipal(Long staffId);
	public TreeNode<InstituteDTO> findTree();
}
